"""
首页页面
"""
from PO.utils import DriverUtil


class IndexPage:
    """
    首页对象层
    """

    def __init__(self):
        """获取浏览器对象"""
        self.driver = DriverUtil.get_driver()

    def find_login_link(self):
        """定位登录方法"""
        return self.driver.find_element("link text", "登录")



class IndexHandle:
    """
    首页操作层
    """

    def __init__(self):
        self.index_login = IndexPage()

    def click_login_link(self):
        self.index_login.find_login_link().click()


class IndexTask:
    """
    首页操作层
    """

    def __init__(self):
        self.index_handle = IndexHandle()

    def go_to_login_page(self):
        """跳转登页面"""
        self.index_handle.click_login_link()
